<template>
  <div class="container">
    <error-tip :errorCode="errorCode" v-if="errorCode"></error-tip>
    <div v-else>
      <card-list :yearData = 'yearData'></card-list>
    </div>
  </div>
</template>

<script>
import { getNowDate } from '@/libs/utils'
import getData from '@/services/index.js'
import { useStore } from 'vuex'
import { onMounted, computed } from 'vue'
import CardList from "@/components/YearPage/List";
export default {
  components: {
    CardList,
  },
  setup() {
    const store = useStore()
    onMounted(() => {
      let field = store.state.field
      getData(store, field, getNowDate(field))
    })
    return {
      yearData: computed(() => store.state.yearData),
      errorCode: computed(() => store.state.errorCode)
    }
  },
  
}
</script>

<style lang="less" scoped>

</style>